<template>
    <div id="flea_mark">
        <div class="credit-tabs ">
            <tab class="list_switch" :line-width="1" active-color='#2f78ec' bar-active-color="#2f78ec">
                <tab-item selected @on-item-click="onItemClick">交易大厅</tab-item>
                <tab-item @on-item-click="onItemClick">已认领客户</tab-item>
            </tab>
            <div class="flea_div"></div>
             <transition-group name="side">
                <deal-loabby :key="0" v-if="indexshow == 0"></deal-loabby>
                <claim-customer :key="1" v-if="indexshow == 1"></claim-customer>
                <div :key="1" v-if="indexshow == 1">ascasda</div>
            </transition-group>
        </div>
        <div class="circle"></div>
  </div>
</template>
<script>
import { Tab, TabItem} from 'vux'
import DealLoabby from '../components/DealLoabby'
import ClaimCustomer from '../components/ClaimCustomer'
import utils from '../utils'
import api from '../api';
export default {
  data(){
    return{
      item: {},
      indexshow: 0
    }
  },
  components:{
    Tab,
    TabItem,
    DealLoabby,
    ClaimCustomer
  },
  created(){
    window.document.title = '跳蚤市场'
    utils.jssdkwx(api, this.$wechat, this.$store)
  },
  methods:{
    //切换
    onItemClick (index){
      if(index == 0){
        this.indexshow = 0
      }else if(index == 1){
        this.indexshow = 1
      }else if(index == 2){
        this.indexshow = 2
      }
    }
  }
}
</script>

